<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="<%=request.getContextPath()%>/common/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/common/FSS.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/common/tiny_mce.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/common/jquery-1.3.min.js"></script>

<script type="text/javascript">

	tinyMCE.init({

		// General options

		mode : "textareas",

		theme : "advanced",

		plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",



		// Theme options

		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",

		theme_advanced_buttons2 : "bullist,numlist,|,forecolor,backcolor",

		theme_advanced_toolbar_location : "top",

		theme_advanced_toolbar_align : "left",

		theme_advanced_statusbar_location : "bottom",

		theme_advanced_resizing : true,



		// Example content CSS (should be your site CSS)

		content_css : "css/content.css",



		// Drop lists for link/image/media/template dialogs

		template_external_list_url : "lists/template_list.js",

		external_link_list_url : "lists/link_list.js",

		external_image_list_url : "lists/image_list.js",

		media_external_list_url : "lists/media_list.js",



		// Style formats

		style_formats : [

			{title : 'Bold text', inline : 'b'},

			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},

			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},

			{title : 'Example 1', inline : 'span', classes : 'example1'},

			{title : 'Example 2', inline : 'span', classes : 'example2'},

			{title : 'Table styles'},

			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}

		],



		// Replace values for the template plugin

		template_replace_values : {

			username : "Some User",

			staffid : "991234"

		}

	});

function fnSubmit(){
	if(checkInput()){
		document.edit.submit();
	}
}

function checkInput(){
	var title=document.getElementById("title").value;
	var content=document.getElementById("elm1").value;
	var type=document.getElementById("type").value;
	
	if(LTrim(title).length == 0){
		alert("タイトルが必須です！");
		$("#title").focus();
		return false;
	}
	
	if(type == 0){
		alert("種類が必須です！");
		$("#type").focus();
		return false;
	}
	
	if(LTrim(elm1).length == 0){
		alert("コンテンツが必須です！");
		$("#elm1").focus();
		return false;
	}
	
	return true;
}
</script>
</head>
<body id="page5">
<div class="tail-right"></div>
<div class="tail-right-top"></div>
<div class="tail-top">
  <div class="tail-bottom">
    <div class="tail-bg">
      <div class="top-bg">
        <div class="tail-right-bot"></div>
        <div class="bot-bg">
          <div id="main">
            <!-- header -->
            <s:form name="login" action="/fssProject/Login" theme="simple">
            <div id="header">
              <h1><a href="<%=request.getContextPath()%>">fss</a></h1>
              <ul class="top-login">
              <s:if test="#session.user_login==null">
                <li><img alt="" src="../images/userid.gif" /></li>
                <li><input type="text" name="user.userId" id="user_name" /></li>
                <li><img alt="" src="../images/password.gif" /></li>
                <li><input type="password" name="user.pwd" id="password" /></li>
                <li><a class="loginbutton" href="javascript:fnLogin();"></a></li>
                <li><a class="registerbutton" href="/fssProject/user/initRegister" ></a></li>
              </s:if><s:else>
              	<li><h4><s:property value="#session.user_login.displayName"/>,Welcome!</h4></li>
              	<li><a class="mypagebutton" href="/fssProject/user/myInfo"></a></li>
                <li><a class="logoutbutton" href="/fssProject/Logout"></a></li>
                </s:else>
              </ul>
            </div>
            </s:form>
            <div class="extra-img"><img alt="" src="../images/extra-img.png" class="png"/></div>
            <div class="wrapper">
              <!-- nav -->
              <div id="nav">
                <ul>
                 <li><a href="/fssProject/mainPage">ホーム</a></li>
                  <li><a href="/fssProject/experience/list"><s:property value="#session.btn1.content"/></a></li>
                  <li><a href="/fssProject/secondHand/list"><s:property value="#session.btn2.content"/></a></li>
                  <s:if test="#session.user_login.userId in {'fss_admin1','fss_admin2','fss_admin3'}">
                  <li><a href="/fssProject/user/userManage">ユーザ管理</a></li>
                  <li><a href="/fssProject/cmsContent/editCMSContent">CMS変更</a></li>
                  </s:if>
                </ul>
              </div>
              <!-- content -->
              <div id="content">
                <div class="section">
                  <!-- box begin -->
                  <div class="box">
                    <div class="left-top-corner png">
                      <div class="right-top-corner png">
                        <div class="border-top png"></div>
                      </div>
                    </div>
                    <div class="border-left png">
                      <div class="border-right png">
                        <div class="inside png">
                          <h2></h2>
                          <div id="message"><h4><font color="Red"><s:property value="msg"/></font></h4></div>
                          <form id="contacts-form" name="edit" method="post" action="edit">
                          <s:hidden name="experience.experienceId"/>
                          <s:hidden name="experience.commentCounter"/>
                            <fieldset>
                              <div class="field">
                                <label>タイトル:</label>
                                <s:textfield id="title" name="experience.title"/>
                              </div>
							  <div class="field">
                                <label>種類:</label>
                                <s:select id="type" list="experienceTypeList"
						listKey="typeId" listValue="typeName" headerKey="0" headerValue="" name="experience.tbExperienceType.typeId"
						cssClass="experience"/>
                              </div>
                              <div class="field">
                                <label>メッセージ:</label>
                                <s:textarea id="elm1" name="experience.content" rows="15" cols="80" style="width: 80%"/>
                              </div>
                              <div class="wrapper">
                                <div><a class="activeNew" href="javascript:fnSubmit();"></a></div>
                              </div>
                            </fieldset>
                          </form>
                        </div>
                      </div>
                    </div>
                    <div class="left-bot-corner png">
                      <div class="right-bot-corner png">
                        <div class="border-bot png"></div>
                      </div>
                    </div>
                  </div>
                  <!-- box end -->
                </div>
              </div>
            </div>
          </div>
          <!-- footer -->
          <div id="footer">
            <div class="indent">
              <div class="fleft">Copyrights - Ritsumeikan University</div>
              <div class="fright">Designed by: <a href="http://www.ritsumei.jp/ise/index_j.html"><img src="../images/designer.gif" /> </a></div>
          </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>